package com.danciyixue.boot.client.word.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.danciyixue.boot.common.result.PageResult;
import com.danciyixue.boot.dcyx.model.query.WordsQuery;
import com.danciyixue.boot.dcyx.model.vo.WordsVO;
import com.danciyixue.boot.dcyx.service.WordsService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 客户端单词控制器
 */
@Tag(name = "10. 单词", description = "单词")
@RestController
@RequestMapping("/api/client/v1/word")
@RequiredArgsConstructor
public class DcyxWordController {

    private final WordsService wordsService;

    /**
     * 获取单词数据
     */
    @GetMapping("/page")
    public PageResult<WordsVO> page(WordsQuery queryParams) {
        IPage<WordsVO> page = wordsService.getWordsPage(queryParams);
        return PageResult.success(page);
    }
} 